import requests
url="http://ihrm-test.itheima.net/api/sys/user"
add_data = {
    "username": "小猪佩奇",
    "mobile": "13967966943",
    "workNumber": "9527"
}
header = {"Content-Type": "application/json", "Authorization": "Bearer adb79083-3bb7-4b93-8b93-07c3a884a485"}
resp = requests.post(url=url,headers=header,json=add_data)
print(resp.json())
url_query="http://ihrm-test.itheima.net/api/sys/user/1539966338192146432"
header_query = {"Content-Type": "application/json", "Authorization": "Bearer adb79083-3bb7-4b93-8b93-07c3a884a485"}
resp_query=requests.get(url=url_query,headers=header_query)
print(resp_query.json())

url_updata="http://ihrm-test.itheima.net/api/sys/user/1539966338192146432"
data_updata={"username": "猪佩奇"}
header_updata = {"Content-Type": "application/json", "Authorization": "Bearer adb79083-3bb7-4b93-8b93-07c3a884a485"}
resp_updata=requests.put(url=url_updata,headers=header_updata,json=data_updata)
print(resp_updata.json())

url_del="http://ihrm-test.itheima.net/api/sys/user/1539966338192146432"
header_del = {"Content-Type": "application/json", "Authorization": "Bearer adb79083-3bb7-4b93-8b93-07c3a884a485"}
resp_del=requests.delete(url=url_del,headers=header_del,)
print(resp_del.json())
